From: Olivier CrĂȘte Date: Wed, 17 May 2023 00:08:34 +0000 (+0100) Subject: pathbar: Fail setting the path on cancellation X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~59^2^2~244^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=22cd3ea2683f2fee9a7c2bb1ebc6be619153add2;p=gtk4.git pathbar: Fail setting the path on cancellation The cancellation path already clears the GCancellable, if we let it continue, it causes a later assertion, so just exit early in this case and hope a new path has been set. Fixes: #5792 --- diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index e8a3b2fc06..d712bec277 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -873,8 +873,18 @@ gtk_path_bar_get_mount_callback (GObject *source, { GFile *file = G_FILE (source); struct SetFileInfo *file_info = data; + GError *error = NULL; - file_info->mount = g_file_find_enclosing_mount_finish (file, result, NULL); + file_info->mount = g_file_find_enclosing_mount_finish (file, result, + &error); + + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + { + gtk_path_bar_set_file_finish (file_info, FALSE); + g_clear_error (&error); + return; + } + g_clear_error (&error); if (file_info->mount) file_info->root_file = g_mount_get_root (file_info->mount);